
{% extends "PATHomeBundle::base.html.twig" %}

{% block title %} Catalogue {% endblock %}

{% block body %}
    Voici le catalogue :

    <div id="catalog">
        {% for category in category_list %}
        <div class="catalogItem">
            
            {% if category.categoryParent.name == 'Multimédia' %}
            <div class="catalogItem_multimedia">
            {% elseif category.categoryParent.name == 'Jeux & Jouets' %}
            <div class="catalogItem_jouets">
            {% elseif category.categoryParent.name == 'Vêtements' %}
            <div class="catalogItem_vetements">
            {% elseif category.categoryParent.name == 'Pokématos' %}
            <div class="catalogItem_pokematos">
            {% else %}
            <div class="catalogItem_default">
            {% endif %}

                <a href="./{{ category.id }}">
                    <div class="catalogItem_img">
                        {% if category.picture.url is defined %}
                            <img src = "{{ asset('bundles/patproduct/images/' ~ category.picture.url) }}" alt = {{ category.picture.title }}/>
                        {% else %}
                            <img src = "{{ asset('bundles/patproduct/images/non_dispo.png') }}" alt="image non disponible"/>
                        {% endif %}
                    </div>
                    <div class="catalogItem_title">
                        {{ category.name }}
                    </div>
                </a>
            </div>
        </div>
        {% endfor %}
    </div>
	
{% endblock %}
